﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;

namespace BAL.EstRec.FDVIndicador
{
    public class RuleExcededBgkColorConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            object convertedValue = null;
            if(targetType == typeof(System.Windows.Media.Brush))
            {
                try
                {
                    bool sourceBool = (bool)value;
                    convertedValue = sourceBool ? System.Windows.Media.Brushes.Red : System.Windows.Media.Brushes.Transparent;
                }
                catch (Exception ex)
                {
                    convertedValue = System.Windows.Media.Brushes.Transparent;
                }
            }
            return convertedValue;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
